package com.qianfeng.smartplatform.mapper;

import com.qianfeng.smartplatform.pojo.User;
import com.qianfeng.smartplatform.pojo.UserExample;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer uId);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExampleWithBLOBs(UserExample example);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer uId);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExampleWithBLOBs(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKeyWithBLOBs(User record);

    int updateByPrimaryKey(User record);

    User selectByUserName(String username);

    User selectByUserNameWithBLOBs(String username);

    Integer selectIdByUserName(String username);

    User selectByPhone(String phone);

    User selectByPhoneWithBLOBs(String phone);

    User selectByEmail(String email);

    User selectByEmailWithBLOBs(String email);

    //跟新用户登录数据
    void updateUserLoginInfoByUserName(@Param("username") String username, @Param("loginDate") Date loginDate, @Param("ip") String ip);
}